/* 全局样式 */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #2c3e50;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --light-color: #f8f9fa;
    --dark-color: #2c3e50;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: var(--dark-color);
}

/* 登录页面样式 */

/* 主界面美化 */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.2rem 2rem;
    background: linear-gradient(90deg, #e3edfa 60%, #f8faff 100%);
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(74,144,226,0.08);
    min-height: 64px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-size: 1.08rem;
    color: #4a90e2;
}

.sidebar {
    background: linear-gradient(180deg, #6a98e7 0%, #4a90e2 100%);
    color: white;
    height: 100vh;
    padding: 2.2rem 1.5rem 1.5rem 1.5rem;
    position: fixed;
    box-shadow: 2px 0 12px rgba(74,144,226,0.10);
    border-radius: 0 18px 18px 0;
    width: 280px;
}

.sidebar-header {
    padding: 1.5rem 0 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 1.2rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.92);
    padding: 1rem 1.2rem;
    margin: 0.4rem 0;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.08rem;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    transform: translateX(6px) scale(1.04);
}

.sidebar .nav-link.active, .sidebar .nav-link:focus {
    background: #e3f0ff;
    color: #205fa3;
    font-weight: 600;
    border-left: 4px solid #4a90e2;
}

.sidebar .nav-link {
    transition: background 0.2s, color 0.2s;
}

.main-content {
    margin-left: 280px;
    padding: 2.5rem 3.5rem;
    background-color: #f8faff;
    min-height: 100vh;
    border-radius: 18px 0 0 0;
    box-shadow: 0 2px 16px rgba(74,144,226,0.06);
}

.card, .stat-card, .chart-container {
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(74,144,226,0.08);
    border: none;
}

.btn, .btn-primary, .btn-success, .btn-danger, .btn-warning {
    border-radius: 8px !important;
    font-size: 1.05rem;
    font-weight: 500;
    padding: 0.6rem 1.3rem;
    box-shadow: 0 2px 8px rgba(74,144,226,0.07);
}

.table {
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(74,144,226,0.06);
    overflow: hidden;
}

.table thead th {
    background-color: #e3edfa;
    color: #4a90e2;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: #f0f7ff;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(74,144,226,0.08);
    margin-bottom: 1.5rem;
    transition: var(--transition);
    background: white;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #eee;
    padding: 1.2rem;
    font-weight: 600;
    border-radius: 14px 14px 0 0;
}

.card-body {
    padding: 1.5rem;
}

/* 表格样式 */
.table {
    margin-bottom: 0;
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background-color: #e3edfa;
    color: #4a90e2;
    font-weight: 600;
    border: none;
    padding: 1rem;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: #f0f7ff;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.3rem;
    font-weight: 500;
    font-size: 1.05rem;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(74,144,226,0.07);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #27ae60);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #f39c12);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
    border: none;
}

/* 表单样式 */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.7rem 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

/* 统计卡片样式 */
.stat-card {
    background: white;
    border-radius: 14px;
    padding: 1.8rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(74,144,226,0.08);
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.stat-card .stat-title {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* 警告提示样式 */
.alert {
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    border: none;
    box-shadow: var(--box-shadow);
}

.alert-success {
    background: linear-gradient(135deg, var(--success-color), #27ae60);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, var(--warning-color), #f39c12);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
    color: white;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 二维码扫描区域样式 */
.scan-area {
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    text-align: center;
    margin: 1.5rem 0;
    transition: var(--transition);
    background-color: white;
}

.scan-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(74, 144, 226, 0.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        z-index: 1000;
        transition: var(--transition);
    }

    .sidebar.show {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .content-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .stat-card {
        margin-bottom: 1rem;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 操作提示 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    margin-bottom: 0.5rem;
    min-width: 200px;
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* 二维码扫描相关样式 */
.scan-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.scan-area {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    overflow: hidden;
}

.scan-area video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

.scan-controls {
    margin-top: 20px;
    text-align: center;
}

/* 二维码显示样式 */
.qr-code {
    width: 128px;
    height: 128px;
    margin: 0 auto;
    padding: 10px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* 打印样式优化 */
@media print {
    .qr-container {
        page-break-inside: avoid;
    }

    .qr-code {
        width: 200px;
        height: 200px;
    }
}

/* 动画效果 */
.fade-enter {
    opacity: 0;
}

.fade-enter-active {
    opacity: 1;
    transition: opacity 0.3s;
}

.fade-exit {
    opacity: 1;
}

.fade-exit-active {
    opacity: 0;
    transition: opacity 0.3s;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 通知面板样式 */
.offcanvas {
    border-left: none;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
}

.offcanvas-header {
    border-bottom: 1px solid #eee;
    padding: 1.2rem;
}

.offcanvas-body {
    padding: 1.5rem;
}

/* 徽章样式 */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 6px;
}

/* 图表容器样式 */
.chart-container {
    background: white;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(74,144,226,0.08);
    margin-bottom: 1.5rem;
}

.menu-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 20px;
}

#contentArea {
    width: 100%;
}

#mainHomeArea {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.menu-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    padding: 25px;
    text-align: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    flex: 1 1 calc(25% - 15px); /* Default: 4 columns */
    max-width: calc(25% - 15px); /* Ensure 4 columns */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    min-height: 180px;
    text-decoration: none;
    color: var(--dark-color);
}

.menu-card:hover {
    box-shadow: 0 8px 32px 0 rgba(80,120,200,0.18);
    transform: translateY(-4px) scale(1.03);
    border-color: #4a90e2;
}

.menu-card .menu-icon {
    font-size: 32px;
    color: #4a90e2;
    margin-bottom: 18px;
    margin-right: 8px;
}

.menu-card .menu-title {
    font-size: 20px;
    font-weight: 600;
    color: #2d3a5a;
    margin-bottom: 8px;
}

.menu-card .menu-desc {
    font-size: 15px;
    color: #888;
    margin-bottom: 0;
}

.menu-card.selected {
    border-color: #205fa3;
    box-shadow: 0 8px 32px 0 rgba(80,120,200,0.22);
    background: #f6faff;
}

@media (max-width: 1200px) {
    .menu-card {
        flex: 1 1 calc(33.33% - 13.33px); /* 3 columns */
        max-width: calc(33.33% - 13.33px);
    }
}

@media (max-width: 900px) {
    .menu-cards {
        /* flex-direction: column; */
        /* align-items: center; */
    }
    .menu-card {
        flex: 1 1 calc(50% - 10px); /* 2 columns */
        max-width: calc(50% - 10px);
        margin-bottom: 20px;
        min-height: 160px;
    }
}

@media (max-width: 600px) {
    .menu-card {
        flex: 1 1 100%; /* 1 column */
        max-width: 100%;
    }
}

/* 首页内容区样式 */
.system-overview {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.overview-item {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.overview-item h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.overview-item p {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
}

.recent-logs {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.recent-logs table {
    width: 100%;
    border-collapse: collapse;
}

.recent-logs th, .recent-logs td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.recent-logs th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.recent-logs tr:hover {
    background: #f1f1f1;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #205fa3;
    margin-bottom: 1.2rem;
    margin-top: 0.5rem;
    letter-spacing: 1px;
}

.dashboard-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #205fa3;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
    letter-spacing: 1px;
} 